<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<LINK rel=stylesheet type=text/css href="../css/style.css">
<script type="text/javascript" src="../scripts/jquery-1.8.3.js"></script>
<script type="text/javascript">
	$(function() {
		$("#login").click(function() {
			var name = $("input[name=name]").val();
			var password = $("input[name=password]").val();
			var matchResult = true;
			if (name == "" || password == "") {
				alert("请确认是否有空缺项！");
				matchResult = false;
			} else if (name.length<2||name.length>20) {
				alert("用户名长度应在2到20个字符之间！");
				matchResult = false;
			} else if (password.length<2||password.length>20) {
				alert("密码长度应在2到20个字符之间！");
				matchResult = false;
			}

			if (matchResult == true) {
				if (name.charAt(0) >= 0 && name.charAt(0) <= 9) {
					alert("用户名不能以数字字符开始！");
					matchResult = false;
				}
			}

			return matchResult;
			$("#user").submit();
		});
	});
</script>
<title>青鸟租房 - 用户登录</title>
</head>

<BODY>
	<DIV id=header class=wrap>
		<DIV id=logo>
			<IMG src="../images/logo.gif">
		</DIV>
	</DIV>
	<DIV id=regLogin class=wrap>
		<DIV class=dialog>
			<DIV class=box>
				<H4>用户登录</H4>
				<FORM id=user method=post name=user action="login.do">
					<DIV class=infos>
						<TABLE class=field>
							<TBODY>
								<TR>
									<TD colSpan=2></TD>
								</TR>
								<TR>
									<TD class=field>用 户 名：</TD>
									<TD>
										<!-- <input type="text" class="text" name="name" /> --> <INPUT
										id=user_name class=text type=text name=name
										value="${sessionScope.name}">
									</TD>
								</TR>
								<TR>
									<TD class=field>密 码：</TD>
									<TD>
										<!-- <input type="password" class="text" name="password" /> -->
										<INPUT id=user_password class=text type=password name=password
										value="${sessionScope.password}">
									</TD>
								</TR>
								<!--
						<tr>
							<td class="field">验 证 码：</td>
							<td><input type="text" class="text verycode" name="veryCode" /></td>
						</tr>
						-->
							</TBODY>
						</TABLE>
						<DIV class=buttons>
							<INPUT value=登陆 type=submit id="login"> <INPUT
								onclick='document.location="regs.jsp"' value=注册 type=button>
						</DIV>
					</DIV>
				</FORM>
			</DIV>
		</DIV>
	</DIV>
	<DIV id=footer class=wrap>
		<DL>
			<DT>青鸟租房 © 2010 北大青鸟 京ICP证1000001号</DT>
			<DD>关于我们 · 联系方式 · 意见反馈 · 帮助中心</DD>
		</DL>
	</DIV>
</BODY>
</HTML>
